Skip to main content
Version: 4.0

Send Message

Path
http://{supOS ip:port}/open-api/p/notification/v2/messages
Request body
{
"businessCode": "businessCode", //required
"businessName": "businessName", //required
"receivers": [ //required
{
"rangeType": "STAFF", //receiver type. STAFF/POSITION/DEPARTMENT/ROLE
"codes": [
"STAFF_CODE" //corresponds to rangeType
]
}
],
"contents": [ //required
{
"protocol": "email",
"content": "{\"subject\":\"title\",\"text\":\"content\"}"
},
{
"protocol": "stationLetter",
"content": "{\"text\":\"content\"}"
}
]
}
Response
  • 200: Successful.
{
"taskCode": "taskCode"
}
  • 400
{
"code": 100000001,
"message": "sender business code cannot be empty"
}
    • 100000001: Sender service name cannot be empty.
    • 100000001: Message receiver range type cannot be empty.
    • 100000001: Message content cannot be empty.
    • 100102009: Receiver does not exist.
    • 100102012: Protocol does not exist.
  • 500
{
"code": 100000001,
"message": "internal service exception"
}

Send Message Based on Topic

Path
http://{supOS ip:port}/open-api/p/notification/v2/topic/messages
Request body
{
"businessCode": "businessCode", //required
"businessName": "businessName", //required
"topicCode": "topicCode", //required
"protocols": [
"stationLetter"
],
"receivers": [
{
"rangeType": "STAFF", //receiver type. STAFF/POSITION/DEPARTMENT/ROLE
"codes": "STAFF_CODE" //corresponds to rangeType
}
],
"param": {}
}
Response
  • 200: Successful.
{
"taskCode": "taskCode"
}
  • 400
{
"code": 100000001,
"message": "sender business code cannot be empty"
}
    • 100000001: Sender service name cannot be empty.
    • 100000001: Topic code cannot be empty.
    • 100000001: Message content cannot be empty.
    • 100102009: Receiver does not exist.
    • 100102012: Protocol does not exist.
    • 100102007: Topic does not exist.
    • 100102008: No linked template with the topic.
    • 100102011: The topic does not contain the protocol.
  • 500
{
"code": 100000001,
"message": "internal service exception"
}

Get User Message

Path
http://{supOS ip:port}/open-api/p/notification/v2alpha1/users/{username}/messages
Query parameter
  • startTime: Required. Format is yyyy-MM-dd'T'HH:mm:ss.SSZ. For example: startTime=2021-01-26T16:02:15.666+0800.
  • endTime: Required. Format is yyyy-MM-dd'T'HH:mm:ss.SSZ. For example: startTime=2021-01-26T16:02:15.666+0800.
  • noticeProtocol: Message reminding method. For example: noticeProtocol=stationLetter.
  • current: Integer. Current page number, starting from 1.
  • pageSize: Integer. Items on the page.
Response
  • 200: Successful.
{
"pagination": {
"current": 1,
"pageSize": 20,
"total": 3
},
"list": [
{
"sender": "work_flow",
"topic": "to-do",
"param": "{\"creator\":\"zhangsan\",\"creationTime\":\"2021-07-26 09:36:49\",\"extendcontent\":\"\",\"title\":\"regression test\",\"content\":\"person-receive notice\",\"url\":\"/project/flow/#/workflowPage?todoId=1531845319510608&processId=1531845294377552&appId=App_93549d29f01ca145d916fd72c1dd6ac6\"}",
"staffCode": "zhangsan",
"staffName": "zhangsan",
"sendStatus": 1,
"readStatus": 1,
"noticeProtocol": "stationLetter",
"errorResult": null
},
{
"sender": "work_flow",
"topic": "to-do",
"param": "{\"creator\":\"zhangsan\",\"creationTime\":\"2021-07-26 09:36:49\",\"extendcontent\":\"\",\"title\":\"regression test\",\"content\":\"person-receive notice\",\"url\":\"/project/flow/#/workflowPage?todoId=1531845319510608&processId=1531845294377552&appId=App_93549d29f01ca145d916fd72c1dd6ac6\"}",
"staffCode": "zhangsan",
"staffName": "zhangsan",
"sendStatus": 1,
"readStatus": 0,
"noticeProtocol": "stationLetter",
"errorResult": null
},
{
"sender": "work_flow",
"topic": "to-do",
"param": "{\"creator\":\"zhangsan\",\"creationTime\":\"2021-07-26 09:36:49\",\"extendcontent\":\"\",\"title\":\"regression test\",\"content\":\"person-receive notice\",\"url\":\"/project/flow/#/workflowPage?todoId=1531845319510608&processId=1531845294377552&appId=App_93549d29f01ca145d916fd72c1dd6ac6\"}",
"staffCode": "zhangsan",
"staffName": "zhangsan",
"sendStatus": 0,
"readStatus": 0,
"noticeProtocol": "stationLetter",
"errorResult": "no channel"
}
]
}
  • 400
{
"code": 100000001,
"message": "start time cannot be empty"
}
    • 100000001: End time cannot be empty.
    • 100102022: User does not exist.
    • 100102023: Start time format is incorrect.
    • 100102024: End time format is incorrect.
    • 100102025: 'current' must be larger than and equal to 1.
    • 100102026: 'pageSize' must be larger than or equal to 1 and smaller than or equal to 500.
    • 100102012: Protocol does not exist.
  • 500
{
"code": 100000001,
"message": "internal service exception"
}